package main

import (
	"fmt"
	"math"
	"strconv"
)

func findTheArrayConcVal(nums []int) int64 {
	l := len(nums)
	j := l - 1
	var i int
	var sum int
	for i = 0; i < j; i++ {
		sum += nums[i]*(int(math.Pow(10, float64(len(strconv.Itoa(nums[j])))))) + nums[j]
		j--
	}
	if j == i {
		sum += nums[i]
	}
	return int64(sum)
}

func main() {
	//fmt.Println(findTheArrayConcVal([]int{7, 52, 2, 4}))
	//fmt.Println()

	nums := []int{1, 2, 2, 2, 3, 3, 3}

	m := make(map[int]byte, 0)
	for _, val := range nums {
		if _, ok := m[val]; ok {
			if m[val] == byte(2) {
				delete(m, val)
				continue
			}
		}
		m[val]++
	}
	for key, val := range m {
		fmt.Println(key, val)
	}

}
